deps: bump the analyzers group and remediate the new Sonar rules - #162
Merged
Conversation
Completes the Dependabot sweep. Bumps Meziantou.Analyzer 3.0.124 -> 3.0.133 and SonarAnalyzer.CSharp 10.29.0.143774 -> 10.30.0.144632 (was #147), which was held out of the consolidated bump PR because 10.30 ships three new rules that fail this build under TreatWarningsAsErrors. S8949 (3 sites) is a REAL defect and is fixed properly. SoftDeletedUserMiddleware was calling the cache and the soft-delete validator without a CancellationToken, even though all three APIs accept one, so a client disconnect never cancelled the lookups. They now pass context.RequestAborted. S8969 (38 sites) is mostly right: 34 were genuine redundant null-forgiving operators and are removed. FOUR were wrong. At those the analyzer claimed the compiler already knew the expression was non-null, and removing the operator immediately failed with CS8602/CS8629. Those four are restored, and the rule is downgraded to a suggestion in .editorconfig: under TreatWarningsAsErrors a false positive is a broken build, not a nudge, so it cannot gate CI at that accuracy. S8970 (3 sites) is wrong at every site it flags here. It claims nullable warnings are disabled and the operator is pointless, but each site is the deliberate `null!` / `default!` initializer pattern in a .razor component, where removing it fails with CS8625/CS8604. Suppressed via NoWarn in Directory.Build.props rather than .editorconfig, because a dotnet_diagnostic severity does not reach Razor-generated code. The measured false-positive rate (7 of 41) is why neither nullability rule is left at error severity. The compiler is the authority on nullability, not the analyzer; both suppressions carry that reasoning inline for whoever revisits them. Full solution 2483/2483 green in Release, 0 warnings; facts --check clean; 25 lock files regenerated. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RpWirEitGZ2AMEQhd7NCD9
This was referenced Jul 28, 2026
ivanball
added a commit
that referenced
this pull request
Jul 29, 2026
The solution-wide restore only reaches projects listed in MMCA.Common.slnx, so the four that deliberately sit outside it kept stale "requested" versions after the analyzer bumps in #162 and earlier: - Source/Presentation/MMCA.Common.UI.Maui (ADR-042, its own windows job) - Tests/Presentation/MMCA.Common.UI.E2E.Tests - Tests/Presentation/MMCA.Common.UI.Gallery - Tests/Core/MMCA.Common.Infrastructure.Redis.Tests Meziantou.Analyzer 3.0.123/3.0.124 to 3.0.133, SonarAnalyzer.CSharp 10.29.0.143774 to 10.30.0.144632, and the Microsoft.IdentityModel transitives 8.19.2 to 8.21.0, all now matching Directory.Packages.props. No behavior change. CI restores without --locked-mode (ci.yml:85), so these projects were already compiling against the current analyzers; this only realigns the recorded lock state. The three non-MAUI projects build clean in Release locally, and MAUI is covered by its dedicated windows job. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Completes the Dependabot sweep. Bumps
Meziantou.Analyzer3.0.124 → 3.0.133 andSonarAnalyzer.CSharp10.29 → 10.30 (was #147), held out of #161 because 10.30 ships three new rules that fail this build underTreatWarningsAsErrors.Each was triaged on its merits rather than bulk-suppressed or bulk-applied.
S8949 (3 sites) — a real defect, fixed properly
SoftDeletedUserMiddlewarecalled the cache and the soft-delete validator without aCancellationToken, even though all three APIs accept one. A client disconnect never cancelled the lookups. They now passcontext.RequestAborted.This one earned its keep: the bump found a genuine bug.
S8969 (38 sites) — mostly right, 4 wrong
34 were genuine redundant null-forgiving operators and are removed.
Four were wrong. The analyzer claimed the compiler already knew the expression was non-null; removing the operator immediately failed with
CS8602/CS8629. Those four are restored, and the rule is downgraded tosuggestionin.editorconfig.Under
TreatWarningsAsErrorsa false positive is a broken build, not a nudge, so a rule at this accuracy cannot gate CI. As a suggestion, real redundancies still surface.S8970 (3 sites) — wrong at every site
It claims nullable warnings are disabled and the operator is pointless. Every flagged site is the deliberate
null!/default!initializer pattern in a.razorcomponent, where removing it fails withCS8625/CS8604.Suppressed via
NoWarninDirectory.Build.propsrather than.editorconfig, because adotnet_diagnosticseverity does not reach Razor-generated code — worth knowing for the next Razor-affecting rule.Why not just suppress all three, or apply all three
The measured false-positive rate was 7 of 41. Applying blindly breaks the build; suppressing blindly would have discarded 34 real cleanups and missed a genuine cancellation bug. Both suppressions carry that reasoning inline for whoever revisits them.
Verification
facts --checkclean.Stacked on #161 conceptually but branched off
main, so it will needgh pr update-branchafter that merges.